package com.firemoss.atonement.test.mapper.objects
{
	import com.firemoss.atonement.mapper.Mapping;
	import com.firemoss.atonement.metadata.Property;
	
	import flash.utils.Dictionary;

	public class AddressDTO extends Convenience
	{
		public var line1 : String
		public var line2 : String;
		
		[PropertyResolver(type="com.firemoss.atonement.test.mapper.objects.AddressDTO", functionName="oneLineAddress")]
		public var addressAsOneLine : String
		public var city : String
		[PropertyResolver(type="com.firemoss.atonement.test.mapper.objects.AddressDTO", functionName="stateCode", sourcePropertyName="state")]
		public var state : String
		public var postalCode : String
		
		public function oneLineAddress ( source : Address, targetProperty : Property, mapping : Mapping, mappingChain : Dictionary ) : String {
			return source.line1 + " " + source.line2
		} 
		
		public function stateCode( source : State, targetProperty : Property, mapping : Mapping, mappingChain : Dictionary ) : String {
			return source.code
		} 
	}
}